<!DOCTYPE html>
<html lang="zh-cn">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <base href=".">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="RippleOK query ripple gateway infomation">
  <title>RippleOK query ripple gateway infomation</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css"/>
  <!-- build:libcss ../assets/css/rippleok-lib.min.css -->
  <!-- bower:css -->
  <link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.css" />
  <!-- endbower -->
  <!-- endbuild -->
  <!-- build:libcss ../assets/css/rippleok.min.css -->
  <!-- injector:css -->
  <link rel="stylesheet" href="../assets/css/rippleok.css">
  <!-- endinjector -->
  <!-- endbuild -->
  <!--  HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries  -->
  <!-- [if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif] -->
</head>

<body ng-app="gatewayApp">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-61799066-1', 'auto');
ga('send', 'pageview');

</script>
  <div class="navbar navbar-default navbar-static-top" ng-cloak>
    <div class="container">
      <div class="navbar-header">
        <button class="navbar-toggle" type="button" ng-click="isCollapsed = !isCollapsed">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <div class="navbar-brand">
          <a href="/" target="_self">
            <span style="font-weight:bold;color:#428bca;">ripple<font style="font-weight:bold;color:#FF9933;">OK</font></span>
          </a>
        </div>
      </div>
      <div collapse="isCollapsed" class="navbar-collapse collapse" id="navbar-main">
        <ul class="nav navbar-nav">
          <li ng-repeat="item in menu" ng-class="{active: isActive(item.link)}">
            <a ng-href="{{item.link}}">{{item.title}}</a>
          </li>
          <li ng-show="isAdmin()" ng-class="{active: isActive('/admin')}">
            <a href="/admin">Admin</a>
          </li>
        </ul>
        <ul class="nav navbar-nav">
          <li ng-cloak>
            <a href="ledger.html" target="_blank">{{lang==0?'Ledger':'总账'}}</a>
          </li>
          <li ng-cloak>
            <a href="transaction.html" target="_blank">{{lang==0?'Transaction':'交易'}}</a>
          </li>
          <li ng-cloak>
            <a href="account.html" target="_blank">{{lang==0?'Account':'账号'}}</a>
          </li>
          <li ng-cloak class="active">
            <a href="gateway.html"  class="bold">{{lang==0?'Gateway':'网关'}}</a>
          </li>
        </ul>
        <form class="nav navbar-nav navbar-right navbar-form">
          <div class="input-group" style="width:800px">
            <input id="address" type="text" class="form-control" onkeydown='if(event.keyCode==13){queryGatewayInfo();}' placeholder="Currency.issuer {{lang==0?'for example':'例如：'}} USD.rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B Currency/Currency.issuer">
            <span class="input-group-btn" style="width:150px">
              <button class="btn btn-primary" type="button" onclick="queryGatewayInfo();">Let's go. ripple
                <span style="font-weight:bold;color:#FF9933;">OK</span> »</button>
            </span>
          </div>
        </form>
      </div>
    </div>
  </div>

  <!-- ----------------------------------------------------------------- -->
  <div class="container" ng-controller="GatewayCtrl" ng-cloak>
    <div class="row">
      <div class="col-md-12">
        <b>{{lang==0?'Name':'网关名称'}}：</b>{{gateway.name}}
        <b>{{lang==0?'Address':'地址'}}：</b>
        <a type='text' href="../ledger/account.html#{{gateway.address}}" target="_blank">{{gateway.address}}</a>
        <b>{{lang==0?'Web':'官网'}}：</b>
        <a href='{{gateway.weburl}}' target='_blank'>{{gateway.weburl}}</a>
      </div>
    </div>
    <div class="row">
      <div class="col-md-12">
        {{goods.currency}}.{{goods.issuer}}/{{money.currency}}.{{money.issuer}}
      </div>
    </div>
    <!-- ---------------------------------------------------------------- -->
    <div class="row">
      <div class="col-md-12">
        <div class="panel panel-default">
          <div class="panel-heading">
            <div class="row">
              <div class="col-md-10">
                <h3 class="panel-title" style="margin-top:3px">{{lang==0?'Gateway offer list':'网关挂单列表'}}</h3>
              </div>
              <div class="col-md-2" style="text-align:right">
                <button type="button" id="loadoffersbtn" class="btn btn-xs btn-link" data-loading-text="Loading...">Fresh</button>
                <button type="button" id="showoffersbtn" class="btn btn-xs btn-link" data-toggle="collapse" data-open-text="+" data-target="#offersdiv">-</button>
              </div>
            </div>
          </div>
          <div class="panel-body" style="max-height: 600px;overflow-y:auto;overflow-x:hidden">
            <div id="offersdiv" class="row ng-cloak collapse in" ng-hide="collapsed">
              <div class="col-md-6" style="border-right: 3px solid #cccccc;">
                <div class="row gridhead">
                  <div class="col-md-2">{{lang==0?'Acount':'挂单人'}}</div>
                  <div class="col-md-2" style="text-align:right">{{money.currency}} {{lang==0?'SUM':'合计'}}</div>
                  <div class="col-md-2" style="text-align:right">{{goods.currency}} {{lang==0?'SUM':'合计'}}</div>
                  <div class="col-md-2" style="text-align:right">{{money.currency}} {{lang==0?'SIZE':'量'}}</div>
                  <div class="col-md-2" style="text-align:right">{{goods.currency}} {{lang==0?'SIZE':'量'}}</div>
                  <div class="col-md-2" style="text-align:center">{{lang==0?'BID Price':'买价'}}</div>
                </div>
                <div class="row gridhead1">
                  <div class="col-md-10" style="text-align:left">{{lang==0?'The latest data Time':'获取数据时间'}}:{{buyofferstime}}</div>
                  <div class="col-md-2 gridhead" style="text-align:center">{{money.currency}}</div>
                </div>
                <div class="row" ng-repeat="offer in buyoffers|limitTo:pagesize" ng-class="{'even':$even,'odd':$odd}">
                  <div class="col-md-2" data-toggle="tooltip" data-placement="right" title="{{offer.account}}">
                    <a type='text' href="../ledger/account.html#{{offer.account}}" target="_blank">{{offer.account_short}}</a>
                  </div>
                  <div class="col-md-2" style="text-align:right">{{offer.moneysum}}</div>
                  <div class="col-md-2" style="text-align:right">{{offer.goodssum}}</div>
                  <div class="col-md-2" style="text-align:right">{{offer.moneysize}}</div>
                  <div class="col-md-2" style="text-align:right">{{offer.goodssize}}</div>
                  <div class="col-md-2" style="text-align:center">{{offer.price}}</div>
                </div>
                <div class="row gridfooter">
                  <div class="col-md-7" style="text-align:center" ng-show="restbuyofferssize>0">
                    <a href="javascript:void(0)" ng-click="getmore();">{{lang==0?'Show more offers. Remainder':'显示更多买单 剩余'}}: <span class="badge">{{restbuyofferssize}}</span>...</a>
                  </div>
                  <div class="col-md-5" style="text-align:center" ng-show="pagesize>20">
                    <a href="javascript:void(0)" ng-click="getfirstpage();">{{lang==0?'Show First page':'显示第一页'}}</a>
                  </div>
                </div>
              </div>
              <div class="col-md-6" style="border-right: 3px solid #cccccc;">
                <div class="row gridhead">
                  <div class="col-md-2" style="text-align:center">{{lang==0?'ASK Price':'卖价'}}</div>
                  <div class="col-md-2" style="text-align:right">{{goods.currency}} {{lang==0?'SIZE':'量'}}</div>
                  <div class="col-md-2" style="text-align:right">{{money.currency}} {{lang==0?'SIZE':'量'}}</div>
                  <div class="col-md-2" style="text-align:right">{{goods.currency}} {{lang==0?'SUM':'合计'}}</div>
                  <div class="col-md-2" style="text-align:right">{{money.currency}} {{lang==0?'SUM':'合计'}}</div>
                  <div class="col-md-2">{{lang==0?'Acount':'挂单人'}}</div>
                </div>
                <div class="row gridhead1">
                  <div class="col-md-2 gridhead" style="text-align:center">{{money.currency}}</div>
                  <div class="col-md-10" style="text-align:right">{{lang==0?'The latest data Time':'获取数据时间'}}:{{saleofferstime}}</div>
                </div>
                <div class="row" ng-repeat="offer in saleoffers|limitTo:pagesize" ng-class="{'even':$even,'odd':$odd}">
                  <div class="col-md-2" style="text-align:center">{{offer.price}}</div>
                  <div class="col-md-2" style="text-align:right">{{offer.goodssize}}</div>
                  <div class="col-md-2" style="text-align:right">{{offer.moneysize}}</div>
                  <div class="col-md-2" style="text-align:right">{{offer.goodssum}}</div>
                  <div class="col-md-2" style="text-align:right">{{offer.moneysum}}</div>
                  <div class="col-md-2" data-toggle="tooltip" data-placement="left" title="{{offer.account}}">
                    <a type='text' href="../ledger/account.html#{{offer.account}}" target="_blank">{{offer.account_short}}</a>
                  </div>
                </div>
                <div class="row gridfooter">
                  <div class="col-md-9" style="text-align:center" ng-show="restsaleofferssize>0">
                    <a href="javascript:void(0)" ng-click="getmore();">{{lang==0?'Show more offers. Remainder':'显示更多卖单 剩余'}}:<span class="badge">{{restsaleofferssize}}</span>...</a>
                  </div>
                  <div class="col-md-3" style="text-align:center" ng-show="restsaleofferssize>0">
                    <a href="javascript:void(0)" ng-click="getall();">{{lang==0?'Show ALL offers':'显示所有挂单'}}</a>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- ------------------------------------------------------------ -->


    <div class="row">
      <div class="col-md-12">
        <div class="panel panel-default">
          <div class="panel-heading">
            <div class="row">
              <div class="col-md-6">
                <h3 class="panel-title" style="margin-top:3px">{{lang==0?'Trade log':'交易记录'}}</h3>
              </div>

              <div class="col-md-6" style="text-align:right">
                <span class="panel-title" class="inline" style="margin-top:3px">{{lang==0?'Show offer action':'显示挂单消单操作'}}</span>
                <div id="onoffofferlog" class="btn-group btn-toggle" ng-click="onoffOfferLog()">
                  <button class="btn btn-xs btn-default" value="true">ON</button>
                  <button class="btn btn-xs btn-info active" value="false">OFF</button>
                </div>
              </div>
            </div>

          </div>
          <div class="panel-body" style="max-height: 200px;overflow-y: auto;">
            <div id="txLoading" class="bold" style="display:none">
              <img src="img/ripplelogo.png" class="loading">Loading gateway data...
            </div>

            <div class="row" ng-repeat="log in loglist track by $index|limitTo:300">
              <div class="col-md-12">
                <span>{{log.datetime}}</span>
                <span style="color:{{log.color}};padding-left:20px;">{{log.info}}</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <footer ng-include="'../components/footer/footer.html'"></footer>
  </div>
  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-61799066-1', 'auto');
    ga('send', 'pageview');

  </script>
  <!-- ----------------------------------------------------------------- -->
  <!--[if lt IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.0/es5-shim.map"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
  <![endif]-->

  <!-- build:libjs ../assets/js/rippleok-lib.min.js -->
  <!-- bower:js -->
  <script src="../bower_components/jquery/dist/jquery.js"></script>
  <script src="../bower_components/angular/angular.js"></script>
  <script src="../bower_components/bootstrap/dist/js/bootstrap.js"></script>
  <script src="../bower_components/angular-resource/angular-resource.js"></script>
  <script src="../bower_components/angular-cookies/angular-cookies.js"></script>
  <script src="../bower_components/angular-sanitize/angular-sanitize.js"></script>
  <script src="../bower_components/lodash/dist/lodash.compat.js"></script>
  <script src="../bower_components/angular-ui-router/release/angular-ui-router.js"></script>
  <script src="../bower_components/ripple/ripple.js"></script>
  <!-- endbower -->
  <!-- endbuild -->

  <!-- build:js({.tmp,client}/ledger) js/gateway.min.js -->
  <!-- injector:js -->
  <script src="../assets/js/ripple-gateways.js"></script>
  <script src="../assets/js/ripple-remote.js"></script>
  <script src="../assets/js/rippleok-util.js"></script>
  <script src="gateway/js/app.js"></script>
  <script src="gateway/js/gatewayinfo.js"></script>
  <script src="gateway/js/gwateway.controller.js"></script>
  <!-- endinjector -->
  <!-- endbuild -->
  <script>
    $('#loadoffersbtn').click(function() {
      var $btn = $(this).button('loading');
      loadoffers(function() {
        $btn.button('reset');
      });
    });

    $("#showoffersbtn").click(function() {
      $(this).button('toggle');
      if ($(this).text() === "-") {
        $(this).button('open');
      } else {
        $(this).button('reset');
      }
    });
  </script>
</body>

</html>
